package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.RemarkClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;
import java.util.Set;

@Slf4j
//todo 降级服务
public class RemarkClientFallback implements FallbackFactory<RemarkClient> {
    @Override
    public RemarkClient create(Throwable cause) {
        log.info("阻塞,调用降级服务,返回值为空");
        return new RemarkClient() {
            @Override
            public Set<Long> queryLiked(List<Long> bizIds) {
                return null;
            }

            @Override
            public void deleteLiked(Long id) {
                log.info("删除点赞失败");
            }
        };
    }
}
